﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using StructureMap;

namespace RanchBuddy.Core.Services.Impl
{
    [Pluggable("Default")]
    public class ValidationService : IValidationService
    {
        public static bool ValidateDate(string date)
        {
            Regex r = new Regex(ConfigurationService.GetRegExDateValidation());
            return r.IsMatch(date);
        }

        public static bool ValidatePasswordComplexity(string password)
        {
            return Regex.IsMatch(password, ConfigurationService.GetRegExPasswordComplexityValidation());
        }

        public static bool ValidateUsernameComplexity(string name)
        {
            return Regex.IsMatch(name,ConfigurationService.GetRegExUsernameComplexityValidation());
        }

        public static bool ValidateEmail(string email)
        {
            Regex r = new Regex(ConfigurationService.GetRegExEmailValidation());
            return r.IsMatch(email);
        }
    }
}
